﻿Public Class FrmMyPass

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        If TextBox1.Text = TextBox2.Text Then
            MsgBox("新旧密码不能相同")
            Return
        End If
        If TextBox2.Text <> TextBox3.Text Then
            MsgBox("新密码和确认密码必须相同!")
            Return
        End If
        Dim ErrString As String = String.Empty
        If SControl._User_ModifyMyPass(UInfo.FSession, TextBox1.Text, TextBox2.Text, ErrString) = False Then
            MsgBox(ErrString)
            Return
        End If
        MsgBox("修改密码成功,请重新登录!")
        Application.Restart()
    End Sub

    Private Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox1.CheckedChanged
        If CheckBox1.Checked Then
            TextBox1.PasswordChar = ""
            TextBox2.PasswordChar = ""
            TextBox3.PasswordChar = ""
        Else
            TextBox1.PasswordChar = "*"
            TextBox2.PasswordChar = "*"
            TextBox3.PasswordChar = "*"
        End If
    End Sub

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        Dispose()
    End Sub
End Class